package com.imut.service.impl;

import com.imut.entity.User;
import com.imut.mapper.UserMapper;
import com.imut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jiangYaPeng
 * @Date 2025-06-11 15:48
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.login(user);
    }

    @Override
    public User selectById(Long id) {
        return userMapper.selectById(id);
    }

    @Override
    public List<User> selectList(User user) {
        return userMapper.selectList(user);
    }

    @Override
    public Boolean insert(User user) {
        int insert = userMapper.insert(user);
        return insert != 0;
    }

    @Override
    public Boolean update(User user) {
        int update = userMapper.update(user);
        return update != 0;
    }

    @Override
    public Boolean deleteById(Long id) {
        int deleteById = userMapper.deleteById(id);
        return deleteById != 0;

    }

    @Override
    public Boolean register(User user) {
        int register = userMapper.register(user);
        return register != 0;

    }
}
